package com.jumi.microservice.dto.request;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.jm.member.common.api.volidator.Validator;
import com.jumi.microservice.enums.CommonEnum;
import com.jumi.microservice.enums.SexEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.time.LocalDate;

@ApiModel(value="会员", description="会员请求参数")
public class JmUserUpdateRequest {


    @ApiModelProperty(value = "会员id")
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(groups = {Validator.UpdateValidator.class})
    @Null(groups = {Validator.SaveValidator.class})
    private Integer id;

    @ApiModelProperty(value = "会员昵称",required = true)
    private String name;

    @ApiModelProperty(value = "真实姓名",required = true)
    @NotNull(message = "真实姓名不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String truename;

    @ApiModelProperty(value = "手机号",required = true)
    @NotNull(message = "用户手机号不能为空")
    @Pattern(regexp = "^1[0-9]{10}$",message = "手机号格式不正确！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String mobile;

    @ApiModelProperty(value = "会员头像")
    private String avatar;

    @ApiModelProperty(value = "会员性别",required = true)
    @NotNull(message = "会员性别不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private SexEnum sex;

    @ApiModelProperty(value = "生日")
    private LocalDate birthday;

    @ApiModelProperty(value = "会员密码")
    @NotNull(message = "会员密码不可为空!",groups = {Validator.CancelValidator.class,Validator.SaveValidator.class})
    @Size(message = "会员密码最大长度为16位!",max = 16)
    private String passwd;

    @ApiModelProperty(value = "支付密码")
    @Size(message = "会员密码最大长度为16位!",max = 16)
    private String paypwd;

    @ApiModelProperty(value = "会员邮箱")
    private String email;

    @ApiModelProperty(value = "qq")
    private String qq;

    @ApiModelProperty(value = "微信号")
    private String wechatNum;

    @ApiModelProperty(value = "微信二维码")
    private String qrWeixinImg;


    @ApiModelProperty(value = "省份",required = true)
    @NotNull(message = "所在省份不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String province;

    @ApiModelProperty(value = "省份id",required = true)
    @NotNull(message = "所在省份不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String provinceId;

    @ApiModelProperty(value = "城市",required = true)
    @NotNull(message = "所在城市不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String city;

    @ApiModelProperty(value = "城市id",required = true)
    @NotNull(message = "所在城市不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String cityId;

    @ApiModelProperty(value = "地区",required = true)
    @NotNull(message = "所在地区不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String area;

    @ApiModelProperty(value = "地区id",required = true)
    @NotNull(message = "所在地区不可为空！",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String areaId;

    @ApiModelProperty(value = "用户来源",required = true)
    @NotNull(message = "平台来源不能为空",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private String client;

    @TableField(exist = false)
    @ApiModelProperty("上级手机号")
    @Null(message = "不允许更新上级!",groups = {Validator.UpdateValidator.class})
    private String upUserMobile;

    @ApiModelProperty("会员主体")
    @NotNull(message = "会员主体不能为空!",groups = {Validator.SaveValidator.class,Validator.UpdateValidator.class})
    private CommonEnum isJumi;

    public String getQrWeixinImg() {
        return qrWeixinImg;
    }

    public void setQrWeixinImg(String qrWeixinImg) {
        this.qrWeixinImg = qrWeixinImg;
    }

    public CommonEnum getIsJumi() {
        return isJumi;
    }

    public void setIsJumi(CommonEnum isJumi) {
        this.isJumi = isJumi;
    }

    public String getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getAreaId() {
        return areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    public Integer getId() {
        return id;
    }

    public String getWechatNum() {
        return wechatNum;
    }

    public void setWechatNum(String wechatNum) {
        this.wechatNum = wechatNum;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTruename() {
        return truename;
    }

    public void setTruename(String truename) {
        this.truename = truename;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public SexEnum getSex() {
        return sex;
    }

    public void setSex(SexEnum sex) {
        this.sex = sex;
    }

    public LocalDate getBirthday() {
        return birthday;
    }

    public void setBirthday(LocalDate birthday) {
        this.birthday = birthday;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public String getPaypwd() {
        return paypwd;
    }

    public void setPaypwd(String paypwd) {
        this.paypwd = paypwd;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }


    public String getClient() {
        return client;
    }

    public void setClient(String client) {
        this.client = client;
    }

    public String getUpUserMobile() {
        return upUserMobile;
    }

    public void setUpUserMobile(String upUserMobile) {
        this.upUserMobile = upUserMobile;
    }
}
